/* Definitions.h
 * Author: mtreece
 * Date: 02/13/2010
 * Purpose:
 *  Header file for Definitions.cpp
 */

#ifndef DEFINITIONS_H
#define DEFINITIONS_H

#include <time.h>        /** Using C library's random functioning **/
#include <stdlib.h>      /** ~ it all comes back to C... *sigh*   **/
#include <cstdlib>       /** For RAND_MAX                         **/

#include <sys/time.h>    /** Use a more precise seed for srand... **/

#include "MoneyWorth.h"
#include "TicketLine.h"

class TicketLine;

class Definitions{
	private:
		/********** Start of parameters for construction **********/

		unsigned int lowerNum, upperNum,
		             lowerPB, upperPB;

		unsigned int ticketCost;

		int verbose;

		/***** Explanation of algorithm-ish ****
		 * "matchingRewards[regNums][binary_PB]" returns worth 
		 *  of a ticket who has regNums-matching regular numbers
		 *  and binary_PB (either 0 or 1) PB matching.
		 */
		unsigned int matchingRewards[6][2];

		/********** End of parameters for construction   **********/

		/* Private method for acquring a random
		 * number between a lower and upper limit...
		 * (used by public methods)...
		 * (limits are inclusive, btw)
		 */
		int getRandNum(int,int);

		/* Small method for determining if the 2nd
		 * param is inside of the 1st param's list.
		 * (Only checks hard-coded 5 values though)
		 *
		 * Returns 1 if it has it, 0 elsewise.
		 */
		int hasNum(int[], int);
	
	public:
		/* Parameters passed in via the direction
		 * appeared in the 'private:' sector above.
		 */
		Definitions(unsigned int, unsigned int, 
		            unsigned int, unsigned int, 
		            unsigned int, int,
		            unsigned int[][2]);

		/* Definitions dummy.
		 */
		Definitions();

		/* Generate a random number for a TicketLine
		 * object
		 */
		int getRandNum();

		/* Generate a random powerball number for
		 * a TicketLine object
		 */
		int getRandPBNum();

		unsigned int ticketPrice();

		int isVerbose();

		/* Calculate the MoneyWorth of a
		 * particular TicketLine off of
		 * a given Winning TicketLine
		 *
		 * 1st param: the winning TicketLine
		 *            to compare other tickets
		 *            with
		 * 2nd param: the TicketLine to check
		 *            and calculate the 
		 *            MoneyWorth of...
		 */
		MoneyWorth* getWorth(TicketLine*, TicketLine*);

};

#endif
